var status = 0;
var eff1 = "#fUI/UIPVP.img/MiniMapIcon/star#";
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#"; //"+ttt+"//美化1
var eff = "#fUI/UIWindow2.img/AttackRangking/1#"; //小皇冠
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#"; //小黄心
var 头顶 = "#fItem/Cash/0501.img/05010002/effect/default/7#";
var tz12 = "#fEffect/CharacterEff/1112924/0/0#"; //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#"; //蓝星
var tz14 = "#fEffect/CharacterEff/1112926/0/0#"; //红星
var 横条 = "#fEffect/SetEff.img/64/backgrnd/20"; //雪人
var us = "#fUI/CashShop.img/CSDiscount/bonus#"; //小黄心
var ums = "#fUI/UIWindowPL.img/GodOfBrain/npcAni3/stand/0#"; //小黄心
var F123 = "#fMob/2400204.img/move/4#"; //迷你女皇
var IconA = "#fEffect/CharacterEff/1112903/0/0#"; //红心
var IconB = "#fEffect/CharacterEff/1112904/0/0#"; //彩心
var IconC = "#fEffect/CharacterEff/1112924/0/0#"; //黄星
var IconD = "#fEffect/CharacterEff/1112925/0/0#"; //蓝星
var IconE = "#fEffect/CharacterEff/1112926/0/0#"; //红星
var IconF = "#fUI/RunnerGame.img/RunnerGameUI/UI/Point/2#"
var 账户 = "#fUI/StatusBar3.img/FadeYesNo/icon5#"; //"+ttt+"//美化1
var 赞助 = "#fUI/StatusBar3.img/FadeYesNo/icon6#"; //"+ttt+"//美化1
var 点卷 = "#fUI/CashShop.img/CashItem/0#"; //"+ttt+"//美化1
var 抵用 = "#fUI/CashShop.img/CashItem_label/0#"; //"+ttt+"//美化1
var 活跃 = "#fUI/CashShop.img/CashItem_label/2#"; //"+ttt+"//美化1
var 积分 = "#fUI/CashShop.img/CashItem_label/3#"; //"+ttt+"//美化1
var PK = "#fUI/CashShop.img/CashItem_label/1#"; //"+ttt+"//美化1
function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (status == 0 && mode == 0) {
		cm.dispose();
		return;
	}
	if (mode == 1) {
		status++;
	} else {
		status--;
	}
	if (cm.getMapId() == 180000001 || cm.getMapId() == 910340000) {
		cm.sendOk("很遗憾，您因为在特殊地图无法使用此功能.")
		cm.dispose();
	} else if (status == 0) {
		var selStr = "#n#r┄┄┄┅═☆#e" + IconF + "[ PPMS随身服务 ]" + IconF + "#n☆═┅┄┄┄\r\n\r\n";
		selStr += "#e#L0#" + IconB + "打开拍卖系统" + IconB + "#l";
		selStr += "          #L1#" + IconB + "进入系统商城" + IconB + "\r\n\r\n";
		selStr += "#L2#" + IconB + "#b所有游戏商店" + IconB + "#l          #L3#" + IconB + "PPMS中介兑换" + IconB + "#l\r\n\r\n";
		selStr += "#L4#" + IconB + "#g玩法模式简介" + IconB + "#l          #L5#" + IconB + "赞助打赏我们" + IconB + "#l\r\n\r\n";
		selStr += "#L6#" + IconB + "#d玩家交流论坛" + IconB + "#l          #L7#" + IconB + "玩家交流QQ群" + IconB + "#l\r\n\r\n";
		cm.sendSimple(selStr);
	} else if (status == 1) {
		switch (selection) {
			case 0:
				cm.dispose();
				cm.openNpc(9001142, "万能NPC"); // 万能NPC
				break;
			case 1:
				cm.dispose();
				cm.enterCS(); // 系统商城
				break;
			case 2:
				cm.dispose();
				cm.openNpc(1052014); //全部商店
				break;
			case 3:
				cm.dispose();
				cm.openNpc(9209000, "兑换中心");
				break;
			case 4:
				cm.dispose();
				cm.openNpc(9050009, "玩法介绍"); //玩法介绍
				break;
			case 5:
				cm.dispose();
				cm.openNpc(9000191, "赞助送礼"); //玩法介绍
				break;
			case 6:
				cm.dispose();
				//cm.openWeb("https://www.ddmxdsf.cn");
				cm.sendOk("#d已经为您打开了浏览器并转接到了PPMS论坛!\r\n");
				break;
				break;
			case 7:
				cm.dispose();
				//cm.openWeb("https://jq.qq.com/?_wv=1027&k=5F349PE");
				//自己创建一个Q群的连接 上面的是打开地址的函数
				cm.sendOk("#d已为您打开PPMS冒险岛①区玩家交流QQ群~");
				break;
			case 11:
				cm.dispose();
				//cm.openWeb("http://www.ddmxdsf.cn/forum.php");
				break;
			case 798:
				cm.dispose();
				cm.openNpc(9310362, "RingQustion");
				break;
			case 8:
				cm.dispose();
				cm.openNpc(1032205, "lhjj");
				break;
			case 9:
				cm.dispose();
				cm.openNpc(9310060);
				break;
			case 11:
				cm.dispose();
				cm.openNpc(2091111, "图腾合成");
				break;
			case 12:
				cm.dispose();
				cm.warp(866010454, 0);
				break;
			case 13:
				cm.dispose();
				cm.warp(273010000, 0);
				break;
			case 14:
				cm.dispose();
				cm.openNpc(9010047, "zhizhuoshenqi");
				break;
			case 15:
				cm.dispose();
				cm.warp(221020701, 0);
				break;
		}
	}
}